﻿using DryIoc;
using Prism.DryIoc;
using Prism.Ioc;
using System.Windows;
using ToDoDemo.Service;
using ToDoDemo.ViewModels;
using ToDoDemo.Views;

namespace ToDoDemo
{
    /// <summary>
    /// Interaction logic for App.xaml
    /// </summary>
    public partial class App : PrismApplication
    {
        protected override Window CreateShell()
        {
            return Container.Resolve<MainView>();
        }
        protected override void RegisterTypes(IContainerRegistry containerRegistry)
        {
            containerRegistry.GetContainer()
               .Register<HttpRestClient>(made: Parameters.Of.Type<string>(serviceKey: "webUrl"));
            containerRegistry.GetContainer().RegisterInstance(@"http://localhost:5175/", serviceKey: "webUrl");

            containerRegistry.Register<IToDoService, ToDoService>();
            containerRegistry.RegisterForNavigation<ToDoView, ToDoViewModel>();
        }
    }

}
